#chart topping歌曲排行榜
singer = ['周杰伦', '张学友', '汪峰', '那英', '赵雷']
song = ['晴天', '吻别', '怒放的生命', '默', '成都']

def menu():
    num = int(input("请输入你要进行的操作的编号：\n"))
    if num == 1:
        print(song)
    elif num == 2:
        print(singer)
    elif num == 3:
        asong = input("请输入你要添加的歌曲：\n")
        song.append(asong)
        print("歌曲添加成功！")
    elif num == 4:
        asinger = input("请输入你要添加的歌手：\n")
        while True:
            if asinger.isdigit():
                asinger = input("请输入正确的歌手名：\n")
            else:
                singer.append(asinger)
                print("歌手添加成功！")
                break
    elif num == 5:
        dsong = input("请输入你要删除的歌曲名：\n")
        while True:
            if dsong in song:
                song.remove(dsong)
                print("歌曲删除成功！")
                break
            else:
                dsong = input("请输入在库的歌曲名：\n")

    elif num == 6:
        dsinger = input("请输入你要删除的歌手名或编号:\n")
        while True:
            if dsinger in singer:
                singer.remove(dsinger)
                print("歌手删除成功！")
                break
            elif dsinger.isdigit() and int(dsinger) > 0:
                singer.pop(int(dsinger) - 1)
                print("歌手删除成功！")
                break
            else:
                dsinger = input("请输入一个合法的值:\n")
    elif num == 7:
        isinger = input("请输入你要搜索的歌手:\n")
        if isinger in singer:
            print("{}在歌手列表中".format(isinger))
    elif num == 8:
        isong = input("请输入你要搜索的歌曲:\n")
        if isong in singer:
            print("{}在歌手列表中".format(isong))
    elif num == 9:
        print("现在有{}名歌手，有{}首歌曲".format(len(singer), len(song)))
    elif num == 10:
        print("已退出系统")
        exit(0)
    else:
        print("请输入正确的编号!")
print("1.显示曲库\n2.显示歌手名单\n3.增加歌曲\n4.增加歌手\n5.删除歌曲\n6.删除歌手\n7.查询歌曲\n8.查询歌手\n9.统计歌手和歌曲数量\n10.退出菜单")

while True:
        menu()